import base from './base';
import services from '@/axios';

const commonAPI = {
  //文件上传
  upload(data) {
    return services({
      headers: {
        'Content-Type': 'multipart/form-data; boundary=something'
      },
      method: 'post',
      url: `${base.test}/common/upload`,
      data: data
    })
  },

  //文件下载
  download(name) {
    return services({
      method: "get",
      url: `${base.test}/common/download`,
      params: {name},
      responseType:'blob'
    })
  }
}

export default commonAPI;